package com.mybatisx.mybatisplus.controller;

import com.mybatisx.mybatisplus.entity.User;
import com.mybatisx.mybatisplus.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyh
 * @since 2021-06-22
 */
@RestController
@RequestMapping("/mybatisplus/user")
public class UserController {

@Autowired
  private UserService userService;
    @RequestMapping("/test")
    public String test1(){

        return  "hello world";
    }

    @RequestMapping("/findAll")
    public List<User> findAll(){

         return   userService.findAll();
    }
}

